// to help IE6 with hover on elements other than a
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// basic form validation
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false;}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
//if (validate_required(firstname,"Please enter your first name")==false)
 // {firstname.focus();return false;}
if (validate_required(email,"Please enter a valid email address")==false)
  {email.focus();return false;}
  if (validate_email(email,"Please enter a valid email address!")==false)
  {email.focus();return false;}
}
}

// open new window 
function newWindow(link) {
  var bookWindow;
  bookWindow = window.open(link, "new1", "status=0,width=500,height=400,scrollbars=0,menubar=0,location=0,resizable=0");
  if (bookWindow.open) {
    bookWindow.close;
  }
  bookWindow.focus();
}

// prompt for external links
function confirmation() {
	var answer = confirm("You are about to leave this Gilead website by opening a new web page.  The site you are linking to is not controlled or endoresd by Gilead, and Gilead is not responsible for its content.")
	if (answer){
		//alert("Bye bye!")
		window.location = this.href;
	}
	else{
		alert("hello")
	}
}









